package com.api.entity;


import com.api.log.FieldAnnotation;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.activerecord.Model;

import java.util.Date;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
* 预约任务 实体类。
*
* @author yangsf
* @since 2024-11-03
*/
@Accessors(chain = true)
@Data(staticConstructor = "create")
@EqualsAndHashCode(callSuper = true)
@Table("tb_task")
public class Task extends Model<Task> {

private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    @FieldAnnotation("id")
    private Long id;

    /**
    * 员工ID
    */
    @FieldAnnotation("员工ID")
    private Long userId;

    /**
    * 类型： 1.企业 2.工程师
    */
    @FieldAnnotation("类型： 1.企业 2.工程师")
    private Integer kind;

    /**
    * 客户ID
    */
    @FieldAnnotation("客户ID")
    private Long rellId;

    /**
    * 预约时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @FieldAnnotation("预约时间")
    private Date taskTime;

    /**
    * 备注信息
    */
    @FieldAnnotation("备注信息")
    private String taskRemark;

    /**
    * 创建时间
    */
    @Column(onInsertValue = "now()")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @FieldAnnotation("创建时间")
    private Date createTime;

    /**
    * 状态：1.正常 0.删除
    */
    @FieldAnnotation("状态：1.正常 0.删除")
    private Integer status;



    @Column(value = "员工名称",ignore = true)
    private String userName;

    @Column(value = "客户名称",ignore = true)
    private String rellName;

}
